package com.cn.study008;

/**
 * @author lw
 * @ClassName Test8012.java
 * @Description
 * @createTime 2023年05月14日 19:59:00
 */
public class Test8012 {
    public static void main(String[] args) {
        int[] num={1,3,-1,5,-2};
        int[] s=new int[5];
        System.out.println("原数组为：");
        for (int i = 0; i < num.length; i++) {
            System.out.print(num[i]+" ");
        }
        int j = s.length-1;
        for (int i = 0; i < num.length; i++) {
            s[j]=num[i];
            j--;
        }
        for (int i = 0; i < s.length; i++) {
            if (s[i]<0){
                s[i]=0;
            }
        }
        System.out.println("\n逆序并处理后的数组为：");
        for (int i = 0; i < s.length; i++) {
            System.out.print(s[i]+" ");
        }
    }
}
